package com.group.library.order.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.group.library.order.dao.OrderMapper;
import com.group.library.order.entity.Order;
import com.group.library.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public PageInfo<Order> findOrder(Integer page, Integer limit, String name, String number) {
        PageHelper.startPage(page,limit);
        List<Order> orders = orderMapper.findOrder(name, number);
        return new PageInfo<Order>(orders);
    }
}
